module.exports = {
	//获取1个dom节点
	get(s) {
		return document.querySelector(s);
	},

	//获取所有符合条件的dom节点
	getAll(s) {
		return document.querySelectorAll(s);
	},
	//渲染导航栏
	tabbar(name) {
		let html = `
        <a href="index.html" class="${
					name === "index" ? "active" : ""
				}"><span class="iconfont icon-shouye"></span> 首页</a>
        <a href="sports_crouse.html" class="${
					name === "sport" ? "active" : ""
				}"><span class="iconfont icon-xinlv"></span>运动</a>

        <a href="mine.html" class="${name === "mine" ? "active" : ""}"
            ><span class="iconfont icon-wode"></span>我的</a
        >
        `;
		this.get(".tabbar").innerHTML = html;
	},
	navbar(name) {
		let html = `
		
				<a href="sports_run.html"class="${name === "run" ? "active" : ""}">跑步</a>
				<a href="sports_ride.html"class="${name === "ride" ? "active" : ""}">骑行</a>
				<a href="sports_crouse.html"class="${
					name === "crouse" ? "active" : ""
				}" >课程训练</a>
			
		`;
		this.get(".navbar").innerHTML = html;
	},
};
